﻿#pragma once

#include "resource.h"
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN             // 从 Windows 头文件中排除极少使用的内容
// Windows 头文件
//#include <windows.h>
// C 运行时头文件
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <assert.h>
// C++ 运行时头文件
#include <memory>
// directx12
#include <dxgi.h>
#include <d3d12.h>
#pragma comment(lib, "dxgi.lib")
#pragma comment(lib, "d3d12.lib")

#include <wrl.h>
namespace wrl = Microsoft::WRL;

#include <dxgi1_6.h>
#include <dxgidebug.h>
#include <d3dcompiler.h>


typedef unsigned int u32;

// Assert that com call to D3D API succeeded
#ifdef _DEBUG
#ifndef Dxcall
#define DXCall(x)								\
if (FAILED(x)) {								\
	char line_number[32];						\
	sprintf_s(line_number, "%u", __LINE__);		\
	OutputDebugStringA("Error in:");			\
	OutputDebugStringA(__FILE__);				\
	OutputDebugStringA("\nLine:");				\
	OutputDebugStringA(line_number);			\
	OutputDebugStringA("\n");					\
	OutputDebugStringA(#x);						\
	OutputDebugStringA("\n");					\
	__debugbreak();								\
}
#endif // !DxCall
#else
#ifndef DXCall
#define DXCall(x) x
#endif // !DxCa17
#endif //_DEBUG

#ifdef _DEBUG
// Sets the name of the com object and outputs a debug string int visual studio's output panel.
#define NAME_D3D12_OBJECT(obj, name)					\
	obj->SetName(name);									\
	OutputDebugStringW(L"::03D12 0bject Created: ");	\
	OutputDebugStringW(name);							\
	OutputDebugStringW(L"\n");
#else
#define NAME_D3D12_OBJEcT(x,name)
#endif // _DEBUG

#include "main.hpp"

